#{extends 'general.html' /} #{set title:'forgetPassword' /}
<head>
<script type="text/javascript">
	$(function(usercurrent) {
		//$('#tablesending').hide();
	});
</script>
<script type="text/javascript">
	function removeEmail(usercurrent) {
		document.getElementById("forgetPasswordEmail").value = "";
	}
</script>
<script type="application/javascript"> 
	
	function sendingPasswordSending(usercurrent){
		$.getJSON('@{ForgetPassword.passwordSending()}',
		{'eMail':document.getElementById("forgetPasswordEmail").value},function(data){
			if(data.res == "done"){
				cancelsending(usercurrent);
			} else {
				alert(data.res);
			}
		});
	}
</script>
<script type="text/javascript">
	var status = document.getElementById("status2");
	var email = document.getElementById("forgetPasswordEmail");

	function checkEmail2(email) {
		var regularEmail = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		if (regularEmail.test(email) == false) {
			document.getElementById("status2").src = "../../../public/images/no.png";
		} else {
			document.getElementById("status2").src = "../../../public/images/ok.png";
		}
	}
</script>
<script type="text/javascript">
	function forgetPassword(usercurrent) {
		//$('#forgetPasswordWithEmail').fadeOut(1000);
		//$('#tablesending').fadeIn(1000);
	}
</script>

<script type="text/javascript">
	function cancelsending(usercurrent) {
		//$('#forgetPasswordWithEmail').fadeIn(1000);
		//$('#tablesending').fadeOut(1000);
	}
</script>
</head>
<body>
	<div id="content">
		<!-- <input type="button" id="forgetPasswordWithEmail"
			value="Forget Password" onclick="forgetPassword()" /> -->
		<table width="88%" border="1" id="tablesending">
			<tr>
				<td>Your email: <input name="forgetPasswordEmail"
					id="forgetPasswordEmail" value="write your email here!" type="text"
					size="45" onkeyup="checkEmail2(this.value)"
					onmousedown="removeEmail(this.value)" /> <img
					src="../../../public/images/no.png" alt="Status" width="20"
					height="20" id="status2" style="margin-left: 5px;" /> <input
					type="submit" id="forgetPasswordBtn" value=" Send Email "
					onclick="javascript:sendingPasswordSending(document.getElementById('usercurrentHiddenInput').value)" />
					<!-- <input type="submit" id="cancelsendingPassword" value=" Cancel "
					onclick="cancelsending()" /></td> -->
			</tr>
		</table>
		<p></p>
	</div>
	<input id="usercurrentHiddenInput" type="hidden" value="${usercurrent}" />

	<div id="sidebar"></div>


</body>
